﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Common
{
    public interface IWordSequence
    {
        void check();
        /// <summary>
        /// Returns a new word sequence with the given word added to the sequence 
        /// </summary>
        /// <param name="word">the word to add to the sequence</param>
        /// <param name="maxSize">the maximum size of the generated sequence</param>
        /// <returns>a new word sequence with the word added (but trimmed to maxSize)</returns>
        IWordSequence addWord(IWord word, int maxSize);
        /// <summary>
        /// Returns the oldest words in the sequence (the newest word is omitted) 
        /// </summary>
        /// <returns>the oldest words in the sequence, with the newest word omitted</returns>
        IWordSequence getOldest();
        /// <summary>
        /// Returns the newest words in the sequence (the old word is omitted)
        /// </summary>
        /// <returns>the newest words in the sequence with the oldest word omitted</returns>
        IWordSequence getNewest();
        /// <summary>
        /// Returns a word sequence that is no longer than the given size, that is
        /// filled in with the newest words from this sequence 
        /// </summary>
        /// <param name="maxSize">the maximum size of the sequence</param>
        /// <returns>a new word sequence, trimmed to maxSize.</returns>
        IWordSequence trim(int maxSize);
        /// <summary>
        /// Returns the n-th word in this sequence
        /// </summary>
        /// <param name="n">which word to return</param>
        /// <returns>the n-th word in this sequence</returns>
        IWord getWord(int n);
        /// <summary>
        /// Returns the number of words in this sequence
        /// </summary>
        /// <returns></returns>
        int size();
        /// <summary>
        /// 
        /// </summary>
        /// <param name="startIndex"></param>
        /// <param name="stopIndex"></param>
        /// <returns>a subsequence with both <code>startIndex</code> and  <code>stopIndex</code> exclusive.</returns>
        IWordSequence getSubSequence(int startIndex, int stopIndex);
        /// <summary>
        /// 
        /// </summary>
        /// <returns>the words of the <code>WordSequence</code>.</returns>
        IWord[] getWords();

        int compareTo(IWordSequence other);

    }
}
